package cn.tq365.action.admin;

import java.io.File;
import java.io.IOException;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import cn.tq365.action.sys.BaseAction;
import cn.tq365.service.admin.AsBaiduConstService;
import cn.tq365.util.baidu.AsBaiduConstUtil;

/**
 * 百度常量信息列表Action
 * 
 * @author lili
 * 
 */
@Controller
@Scope("prototype")
public class AsBaiduConstAction extends BaseAction {
	@Resource
	private AsBaiduConstService asBaiduConstService;

	private File regionsFile;

	@Override
	public Object getModel() {
		return null;
	}

	@Override
	public void prepare() throws Exception {
	}

	/**
	 * 上传地域常量列表文件
	 * 
	 * @return
	 * @throws IOException
	 */
	public String upRegions() {
		if (AsBaiduConstUtil.update(regionsFile)) {
		} else {
			this.print(this.ERROR);
		}
		return null;
	}

	public void setRegionsFile(File regionsFile) {
		this.regionsFile = regionsFile;
	}

}
